<template>
  <div class="box">
    <el-table :data="newData" border style="width: 100%">
      <el-table-column prop="text" label="姓名" align="center" />
      <el-table-column prop="state" label="状态" align="center">
        <template #default="scope">
          <el-checkbox v-model="scope.row.state" size="large">{{scope.row.state}}</el-checkbox>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        {
          cell1: { text: "李四1", state: true },
          cell2: { text: "李四4", state: true },
          cell3: { text: "李四13", state: true },
        },
        {
          cell: { text: "李四1", state: true },
          cell2: { text: "李四2", state: true },
          cell3: { text: "李四13", state: false },
        },
        {
          cell: { text: "王五7", state: true },
          cell2: { text: "李四2", state: true },
          cell3: { text: "李四9", state: false },
        },
      ],
      newData: [],
    };
  },
  created() {
    this.text();
  },
  methods: {
    text() {
      this.tableData.forEach((item) => {
        this.newData.push(...Object.values(item))
      });
    },
  },
};
</script>

<style lang="less" scoped>
.box {
  width: 500px;
  margin: 100px auto;
}
</style>